<?php $this->load->view('header'); ?>

<!-- start content-outer ........................................................................................................................START -->
<div id="content-outer">
    <!-- start content -->
    <div id="content">

        <!--  start page-heading -->
        <div id="page-heading">
            <h1>Manage <span style=" text-transform:capitalize;"><?php echo $type; ?></span>  Subscriber(s)</h1>
        </div>
        <!-- end page-heading -->

        <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
            <tr>
                <th rowspan="3" class="sized"><img src="<?php echo base_url(); ?>images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
                <th class="topleft"></th>
                <td id="tbl-border-top">&nbsp;</td>
                <th class="topright"></th>
                <th rowspan="3" class="sized"><img src="<?php echo base_url(); ?>images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
            </tr>
            <tr>
                <td id="tbl-border-left"></td>
                <td>
                    <!--  start content-table-inner ...................................................................... START -->
                    <div id="content-table-inner">


                        <!--  start table-content  -->
                        <div id="table-content">

                            <!--  start table-content  -->
                            <div id="table-content">



                                <?php if (isset($sys_msg) && $sys_msg == "updated") { ?>

                                    <!--  start message-blue -->
                                    <div id="message-blue">
                                        <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td class="blue-left">Subscriber(s) updated successfully.</td>
                                                <td class="blue-right"><a class="close-blue"><img src="<?php echo base_url(); ?>images/table/icon_close_blue.gif"   alt="" /></a></td>
                                            </tr>
                                        </table>
                                    </div>
                                    <!--  end message-blue -->

                                <?php } ?>

                                <?php /* Hide message

                                  <!--  start message-blue -->
                                  <div id="message-blue">
                                  <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                  <tr>
                                  <td class="blue-left">Welcome back, User Name </td>
                                  <td class="blue-right"><a class="close-blue"><img src="<?php echo base_url();?>images/table/icon_close_blue.gif"   alt="" /></a></td>
                                  </tr>
                                  </table>
                                  </div>
                                  <!--  end message-blue -->

                                  <!--  start message-yellow -->
                                  <div id="message-yellow">
                                  <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                  <tr>
                                  <td class="yellow-left">You have a new message. <a href="">Go to Inbox.</a></td>
                                  <td class="yellow-right"><a class="close-yellow"><img src="images/table/icon_close_yellow.gif"   alt="" /></a></td>
                                  </tr>
                                  </table>
                                  </div>
                                  <!--  end message-yellow -->

                                  <!--  start message-red -->
                                  <div id="message-red">
                                  <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                  <tr>
                                  <td class="red-left">Error. <a href="">Please try again.</a></td>
                                  <td class="red-right"><a class="close-red"><img src="images/table/icon_close_red.gif"   alt="" /></a></td>
                                  </tr>
                                  </table>
                                  </div>
                                  <!--  end message-red -->



                                  <!--  start message-green -->
                                  <div id="message-green">
                                  <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                  <tr>
                                  <td class="green-left">Product added sucessfully. <a href="">Add new one.</a></td>
                                  <td class="green-right"><a class="close-green"><img src="images/table/icon_close_green.gif"   alt="" /></a></td>
                                  </tr>
                                  </table>
                                  </div>
                                  <!--  end message-green -->

                                 */ ?>

                                <div id="table-content-left">

                                    <div id="pending-post-property-request">

                                        <!--  start product-table ..................................................................................... -->
                                        <form id="mainform" class="list_item_form" method="post" >

                                            <input type="hidden" name="redirect" value="<?php echo 'subscribers/' . $type . '/' . $verified . '/' . $status . '/' . $page . '/10/'; ?>" />

                                            <table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
                                                <tr>
                                                    <th class="table-header-check"><a id="toggle-all" ></a> </th>
                                                    <th class="table-header-repeat line-left minwidth-1"><a href="">First Name</a></th>
                                                    <th class="table-header-repeat line-left"><a href="">Last Name</a></th>
                                                    <th class="table-header-repeat line-left"><a href="">Email</a></th>
                                                    <th class="table-header-repeat line-left"><a href="">Details</a></th>
                                                    <th class="table-header-options line-left"><a href="">Options</a></th>
                                                </tr>

                                                <?php if ($subscribers->num_rows() > 0) { ?>

                                                    <?php foreach ($subscribers->result() as $subscriber) { ?>

                                                        <tr>
                                                            <td valign="top"><input name="selected[]" id="selected" type="checkbox" value="<?php echo $subscriber->subscriber_id; ?>" /></td>
                                                            <td valign="top"><?php echo $subscriber->first_name; ?></td>
                                                            <td valign="top"><?php echo $subscriber->last_name; ?></td>
                                                            <td valign="top"><?php echo $subscriber->email; ?></td>
                                                            <td valign="top">
                                                                <div class="date_div">
                                                                    Status: 

                                                                    <?php
                                                                    if (!$subscriber->status) {
                                                                        echo "Unsubscribed";
                                                                    } else {
                                                                        echo "Subscribed";
                                                                    }
                                                                    ?>

                                                                    <small>
                                                                        <?php
                                                                        if (!is_null($subscriber->date_verified) && $subscriber->date_verified != "") {
                                                                            echo "Verified on: " . date('d-m-Y g:i a', strtotime($subscriber->date_verified));
                                                                        }
                                                                        ?>
                                                                    </small>
                                                                </div>

                                                            </td>
                                                            <td class="options-width" valign="top">

                                                                <a href="<?php echo base_url(); ?>subscribers/changestatus/<?php echo $subscriber->subscriber_id; ?>/<?php
                                                                if ($subscriber->status == "1") {
                                                                    echo "0";
                                                                } else {
                                                                    echo "1";
                                                                }
                                                                ?>/<?php echo $type; ?>/<?php echo $verified; ?>/<?php echo $status; ?>/<?php echo $page; ?>" title="Change Status" class="icon-3 info-tooltip"></a>
                                                            </td>
                                                        </tr>

                                                    <?php } //end for ?>

<?php } //end if  ?>

                                            </table>
                                            <!--  end product-table................................... --> 
                                        </form>

                                        <!--  start actions-box ............................................... -->
                                        <div id="actions-box">
                                            <a href="" class="action-slider"></a>
                                            <div id="actions-box-slider">
                                                <a href="<?php echo base_url(); ?>subscribers/bulk_process/changestatus/1" title="Set selected status to active" class="action-edit action-invoke info-tooltip">Set to Subscribe</a>
                                                <a href="<?php echo base_url(); ?>subscribers/bulk_process/changestatus/0" title="Set selected status to inactive" class="action-edit  action-invoke info-tooltip">Set to Unsubscribe</a>



                                            </div>
                                            <div class="clear"></div>
                                        </div>
                                        <!-- end actions-box........... -->

                                        <!--  start paging..................................................... -->
                                        <table border="0" cellpadding="0" cellspacing="0" id="paging-table">
                                            <tr>
                                                <td class="page-cell">
<?php echo $paginator; ?>
                                                </td>
                                                <td>
                                                    <form id="change_perpageform" method="post">
                                                        <select  class="styledselect_pages perpage">
                                                            <option value="">Number of rows</option>
                                                            <option value="10" <?php if ($this->session->userdata('admin_perpage') == "2") { ?>selected="selected"<?php } ?>>2</option>
                                                            <option value="10" <?php if ($this->session->userdata('admin_perpage') == "10") { ?>selected="selected"<?php } ?>>10</option>
                                                            <option value="20" <?php if ($this->session->userdata('admin_perpage') == "20") { ?>selected="selected"<?php } ?>>20</option>
                                                            <option value="50" <?php if ($this->session->userdata('admin_perpage') == "50") { ?>selected="selected"<?php } ?>>50</option>
                                                        </select>
                                                        <input type="hidden" value="<?php echo current_url(); ?>" name="redirect" />
                                                    </form>
                                                </td>
                                                <td>
                                                    <a href="<?php echo base_url(); ?>settings/set_perpage/" title="Change no. of rows" class="icon-1 change_perpage info-tooltip"></a>
                                                </td>
                                            </tr>
                                        </table>
                                        <!--  end paging................ -->

                                        <div class="clear"></div>

                                    </div> <!-- end pending-post-property-request -->

                                </div> <!-- end table-content-left -->

                                <div id="table-content-right">

<?php $this->load->view('related_activity'); ?>


                                </div> <!-- end table-content-right -->
                                <div class="clear"></div>

                            </div>
                            <!--  end table-content  -->

                        </div>
                        <!--  end content-table-inner ............................................END  -->
                </td>
                <td id="tbl-border-right"></td>
            </tr>
            <tr>
                <th class="sized bottomleft"></th>
                <td id="tbl-border-bottom">&nbsp;</td>
                <th class="sized bottomright"></th>
            </tr>
        </table>
        <div class="clear">&nbsp;</div>

    </div>
    <!--  end content -->
    <div class="clear">&nbsp;</div>
</div>
<!--  end content-outer........................................................END -->

<div class="clear">&nbsp;</div>

<?php
$this->load->view('footer')?>